//
//  KFDFileHelper.m
//  KFD
//
//  Created by JIRENTIANXIANG on 6/5/15.
//  Copyright (c) 2015 KFD. All rights reserved.
//

#import "KFDFileHelper.h"

@implementation KFDFileHelper

+(NSURL*)applicationDataDirectory
{
    NSFileManager* sharedFM = [NSFileManager defaultManager];
    NSArray* possibleURLs = [sharedFM URLsForDirectory:NSApplicationSupportDirectory                                         inDomains:NSUserDomainMask];
    NSURL* appSupportDir = nil;
    if ([possibleURLs count] >= 1) {
        appSupportDir = possibleURLs[0];
        if (![sharedFM fileExistsAtPath:appSupportDir.path]) {
            [sharedFM createDirectoryAtPath:appSupportDir.path withIntermediateDirectories:YES attributes:nil error:nil];
        }
    }
    return appSupportDir;
    
}

@end
